package org.example.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.entity.Dizhi;

import java.util.List;

@Mapper
public interface Dizhimapper {
    /**
     * 查询地址
     * @param username
     * @return
     */
    @Select("select * from dizhi where username=#{username}")
    List<Dizhi> cx(String username);

    /**
     * 新增地址
     * @param dizhi
     */
    void xz(Dizhi dizhi);

    /**
     * 删除
     * @param username
     * @param id
     */
    @Delete("delete from dizhi where username=#{username} and id=#{id}")
    void sc(String username, int id);
    /**
     * 删除
     * @param username
     * @param
     */
    @Delete("delete from dizhi where username=#{username} ")
    void zx(String username);
}
